/**
 * Copyright 2008 Matthew DeLambo
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.delambo.drool.interfaces;

import java.util.*;

public interface ImmutableMap<K, V> {
    
    interface Factory {
        ImmutableMap create(Map map);
    }
    
    /**
     * Given a key, returns the mapped value.
     * @param key key to look up value.
     * @return value that matches key.
     */
    public V get(Object key);
    
    /**
     * Returns the size if the map.
     * @return size of map.
     */
    public int size();
    
    /**
     * Checks for the given key in the map.
     * @param key key to be checked.
     * @return true, if key exists; otherwise, false.
     */
    public boolean containsKey(Object key);
    
    /**
     * Checks for the given value in the map.
     * @param value value to be checked for key.
     * @return true, if value exists; otherwise, false.
     */
    public boolean containsValue(Object value);
    
    /**
     * Returns a Set view of the mappings contained in this map.
     * @return entry set.
     */
    public Set entrySet();
    
    /**
     * Returns a Set view of the keys contained in this map.
     * @return key set.
     */
    public Set keySet();
    
    /**
     * Returns a Collection view of the values contained in this map.
     * @return collection of mapped values.
     */
    public Collection values();
    
    /**
     * Returns true if this map contains no key-value mappings.
     * @return true, if no mappings; otherwise, false.
     */
    public boolean isEmpty();
}
